(function(w, d){

    var dialog = d.getElementById('dialog'),
        wechatqr = d.getElementById('wechatqr'),
        weiboqr = d.getElementById('weiboqr'),
        renrenoqr = d.getElementById('renrenoqr'),
        juanzhuqr = d.getElementById('juanzhuqr'),
        ct = d.getElementById('cover');

    d.getElementById('wechat').onclick = function(){
        dialog.style.display = 'block';
        ct.className += ' row ';
        wechatqr.style.display = 'block'
    }

    d.getElementById('renren').onclick = function(){
        dialog.style.display = 'block';
        ct.className += ' row ';
        renrenoqr.style.display = 'block'
    }

    d.getElementById('juanzhu').onclick = function(){
        dialog.style.display = 'block';
        ct.className += ' row ';
        juanzhuqr.style.display = 'block'
    }

    d.getElementById('weibo').onclick = function(){
        dialog.style.display = 'block';
        ct.className += ' row ';
        weiboqr.style.display = 'block'
    }

    d.getElementById('jianyi').onclick = function(e){
        if(e.target.nodeName === 'WB:PUBLISH') return false;
        var res = confirm('请在弹出的微博发布框中@畅校园 并附上你的建议或意（tu）见（cao），小畅会及时回复你哦，谢谢~');
        if(res === true){
            d.getElementById('weiboPwb').click();
        }
    }

    dialog.onclick = function(e){
        if(e.target.nodeName === 'DIV'){
            dialog.style.display = 'none';
            wechatqr.style.display = 'none';
            renrenoqr.style.display = 'none';
            juanzhuqr.style.display = 'none';
            weiboqr.style.display = 'none';
            ct.className = ct.className.replace(/row/, '');
        }
    }

})(window, document);
